/**
 * <p>Copyright (c) 2010 by DRM. </p>
 */

package com.responsemeasure.to;

import java.io.Serializable;

/**
 * <p><b>CLASS:</b> com.android.drm.to.User</p>
 *
 * ...........................................................................
 * <p><b>DESCRIPTION:</b><br/>
 * Data transfer object for user.
 * </p>
 * 
 * ...........................................................................
 * <p><b>MODIFICATION HISTORY:</b>
 * <p>[2010/07/29] emilygu: Initial version.</p>
 * </p>
 * 
 * ...........................................................................
 * @author emilygu
 * @since 1.0
 */

public class User implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private long id;
	private Integer age;
	private String userName;
	
	/**
	 * @param userName
	 */
	public User(String userName) {
		super();
		this.userName = userName;
	}
	
	/**
	 * @param age
	 * @param userName
	 */
	public User(Integer age, String userName) {
		super();
		this.age = age;
		this.userName = userName;
	}
	
	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}

	/**
	 * @return the age
	 */
	public Integer getAge() {
		return age;
	}
	/**
	 * @return the userName
	 */
	public String getUserName() {
		return userName;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}
	/**
	 * @param age the age to set
	 */
	public void setAge(Integer age) {
		this.age = age;
	}
	/**
	 * @param userName the userName to set
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((userName == null) ? 0 : userName.hashCode());
		return result;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		User other = (User) obj;
		if (userName == null) {
			if (other.userName != null)
				return false;
		} else if (!userName.equals(other.userName))
			return false;
		return true;
	}
}

